package com.huanying.goodjob.business;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.huanying.framework.adminuser.Adminuser;
import com.huanying.framework.user.User;
import com.huanying.goodjob.community.Area;

@Entity
@Table(name="businesslist")
public class BusinessList implements Serializable{
	
	private static final long serialVersionUID = -2697936683291150264L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id")
	private int id;//工单编号
	@OneToOne(cascade = CascadeType.ALL)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "adminuser_id")
	private Adminuser adminuser; // 业务员
	private String shopname;//店铺名
	private Double address_x;//经度
	private Double address_y;//纬度
	@Column(name="is_interview",nullable=false,columnDefinition="INT default 1")
    private int is_interview;//是否面谈：0非 1是
	@Column(name="is_shopowner",nullable=false,columnDefinition="INT default 1")
    private int is_shopowner;//是否是和店主：0非 1是
	@Column(name="is_writen",nullable=false,columnDefinition="INT default 1")
    private int is_writen;//是否签单：0未签单 1已签单
	private Date create_time;//创建时间
	@Column(name="status",nullable=false,columnDefinition="INT default 1")
    private int status;//状态：0禁用 1可用
	@Column(name="is_relation",nullable=false,columnDefinition="INT default 1")
    private int is_relation;//关联状态：0非关联 1关联
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "city_code")
	private Area city;  //城市

	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "province_code")
	private Area province;//省
	@OneToOne(cascade = CascadeType.REFRESH, optional = true)
	@JoinColumn(name = "county_code")
	private Area county; // 县或区
	public Area getCounty() {
		return county;
	}
	public void setCounty(Area county) {
		this.county = county;
	}
	public Area getCity() {
		return city;
	}
	public void setCity(Area city) {
		this.city = city;
	}
	public Area getProvince() {
		return province;
	}
	public void setProvince(Area province) {
		this.province = province;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	public Adminuser getAdminuser() {
		return adminuser;
	}
	public void setAdminuser(Adminuser adminuser) {
		this.adminuser = adminuser;
	}
	
	
	public String getShopname() {
		return shopname;
	}
	public void setShopname(String shopname) {
		this.shopname = shopname;
	}
	public Double getAddress_x() {
		return address_x;
	}
	public void setAddress_x(Double address_x) {
		this.address_x = address_x;
	}
	public Double getAddress_y() {
		return address_y;
	}
	public void setAddress_y(Double address_y) {
		this.address_y = address_y;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	public int getIs_interview() {
		return is_interview;
	}
	public void setIs_interview(int is_interview) {
		this.is_interview = is_interview;
	}
	public int getIs_shopowner() {
		return is_shopowner;
	}
	public void setIs_shopowner(int is_shopowner) {
		this.is_shopowner = is_shopowner;
	}
	public int getIs_writen() {
		return is_writen;
	}
	public void setIs_writen(int is_writen) {
		this.is_writen = is_writen;
	}
	public Date getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Date create_time) {
		this.create_time = create_time;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getIs_relation() {
		return is_relation;
	}
	public void setIs_relation(int is_relation) {
		this.is_relation = is_relation;
	}
	
	
}
